<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script src="../lib/promise.js"></script>
<script>
    const p1 = Promise.resolve(3);
    const p2 = Promise.resolve(Promise.resolve(4));
    const p3 = Promise.resolve(Promise.reject(5));
    const p4 = Promise.reject(6);

    p1.then((value) => console.log('p1 value', value));
    p2.then((value) => console.log('p2 value', value));
    p3.catch((reason) => console.log('p3 reason', reason));
    p4.catch((reason) => console.log('p4 reason', reason));
</script>
</body>
</html>
